<template>
	<view class="message">
		<u-modal :show="show" title="提示" :content='content' @confirm='confirmTrue' @cancel='show=false'
			showCancelButton="true">
			<view class="slot-content">
				选中  <span style='color: #007AFF;margin: 0 8rpx;'>{{content}}</span> ?
			</view>
		</u-modal>
		<plate-input :list="list" :fileds="['name']" @onSelect="lll"></plate-input>
	</view>
</template>
<script>
	import plateInput from '@/pagesA/common/a-indexed-list/a-indexed-list.vue';
	import store from "@/store/index.js"
	export default {
		components: {
			plateInput
		},
		data() {
			return {
				list: [],
				show: false,
				content: '',
				clickTrue: '',
			}
		},
		onLoad() {
			var listVal = []
			this.$request('tbMoveCar/getInsCompany', {}, 'get', {}).then(res => {
				for (let item of Object.entries(res)) {
					var obj = {
						'letter': '',
						'data': []
					}
					obj.letter = item[0]
					obj.data = item[1].data
					listVal.push(obj)
				}
				this.list = listVal
			})
		},
		methods: {
			lll(item, index, cindex) {
				// this.clickTrue = item
				// this.show = true
				// this.content =  item.name 
				this.$store.commit("changCompanyCarName", item.name)
				this.$store.commit("changCompanyCarId", item.insId)
				// B页面
				let pages = getCurrentPages();  //获取所有页面栈实例列表
				let nowPage = pages[ pages.length - 1];  //当前页页面实例
				let prevPage = pages[ pages.length - 2 ];  //上一页页面实例
				
				prevPage.$vm.dataList.insCompany = item.name;   //修改上一页data里面的searchVal参数值为1211
				prevPage.$vm.dataList.insCompanyId = item.insId;   //修改上一页data里面的searchVal参数值为1211
				
				
				uni.navigateBack({  //uni.navigateTo跳转的返回，默认1为返回上一级
					delta: 1
				});
			},
			confirmTrue() {
				
				
					
				this.show = false
			}

		}
	}
</script>
